import request from '@/utils/request';

// 查询商品基本信息列表
export function listGoods(query) {
	return request({
		url: '/mall/goods/list',
		method: 'post',
		data: query,
	});
}

// 查询商品基本信息详细
export function getGoods(id) {
	return request({
		url: '/mall/goods/getInfo',
		method: 'post',
		data: { id: id },
	});
}

// 新增商品基本信息
export function addGoods(data) {
	return request({
		url: '/mall/goods/add',
		method: 'post',
		data: data,
	});
}

// 编辑商品基本信息
export function updateGoods(data) {
	return request({
		url: '/mall/goods/edit',
		method: 'post',
		data: data,
	});
}

export function updateGoodsList(data) {
	return request({
		url: '/mall/goods/editList',
		method: 'post',
		data: data,
	});
}
// 删除商品基本信息
export function delGoods(id) {
	return request({
		url: '/mall/goods/remove',
		method: 'post',
		data: { id: id },
	});
}

// 导出商品基本信息
export function exportGoods(query) {
	return request({
		url: '/mall/goods/export',
		method: 'post',
		data: query,
	});
}
// 最新商品
export function newGoods(query) {
	return request({
		url: '/mall/goods/newGoods',
		method: 'post',
		data: query,
	});
}

export const getInfoGoodsVo = (id) => {
	return request({
		url: '/mall/goods/getInfoGoodsVo',
		method: 'post',
		data: id,
	});
};

export const updateGoodsPo = (data) => {
	return request({
		url: '/mall/goods/updateGoodsPo',
		method: 'post',
		data: data,
	});
};

//供应商商品相关
export const getSupplierGoods = (data) => {
	return request({
		url: '/mall/supplier-goods/list',
		method: 'post',
		data: data,
	});
};
export const addSupplierGoods = (data) => {
	return request({
		url: '/mall/supplier-goods/add',
		method: 'post',
		data: data,
	});
};
export const getSupplierAudit = (data) => {
	return request({
		url: '/mall/supplier-goods/audit-list',
		method: 'post',
		data: data,
	});
};
export const getAuditGoods = (data) => {
	return request({
		url: '/mall/goods/audit-list',
		method: 'post',
		data: data,
	});
};
export const getAuditStoreGoods = (data) => {
	return request({
		url: '/mall/storeGoods/audit-store-list',
		method: 'post',
		data: data,
	});
};
export const auditGoods = (data) => {
	return request({
		url: '/mall/goods/audit',
		method: 'post',
		data,
	});
};
export const querySupplier = (data) => {
	return request({
		url: '/mall/supplier-goods/query/' + data,
		method: 'get',
	});
};
export const querySupplierDetails = (data) => {
	return request({
		url: '/mall/supplier-goods/queryAdmin/' + data,
		method: 'get',
	});
};
export const editSupplier = (data) => {
	return request({
		url: 'mall/supplier-goods/edit',
		method: 'put',
		data,
	});
};
export const delSupplier = (data) => {
	return request({
		url: 'mall/supplier-goods/remove/' + data,
		method: 'delete',
	});
};
export const downGoods = (data) => {
	return request({
		url: '/mall/supplier-goods/down',
		method: 'post',
		data,
	});
};
export const upGoods = (data) => {
	return request({
		url: '/mall/supplier-goods/up',
		method: 'post',
		data,
	});
};
export const getStoreGoods = (data) => {
	return request({
		url: '/mall/store-goods/list',
		method: 'post',
		data: data,
	});
};
export const addStoreGoods = (data) => {
	return request({
		url: '/mall/store-goods/add',
		method: 'post',
		data: data,
	});
};

export const delStore = (data) => {
	return request({
		url: 'mall/store-goods/remove/' + data,
		method: 'delete',
	});
};

export const getStoreAudit = (data) => {
	return request({
		url: '/mall/store-goods/audit-list',
		method: 'post',
		data: data,
	});
};
